<template>
  <Row>
    <Button type="primary" @click="add">操作</Button>
    <Button type="default" @click="add2">操作</Button>
  </Row>
  <Table :columns="column" :data="data"></Table>
</template>
<script lang="jsx">
import test from './250924_5_1.vue'
import { resolveComponent as r } from 'vue'
export default {
  data() {
    return {
      a: 1,
      column: [
        {
          title: 'A',
          key: 'name'
        },
        {
          title: 'B',
          key: 'age',
          render(h) {
            return h(
              r('Button'),
              {
                props: {
                  type: 'default'
                }
              },
              '测试'
            )
          }
        }
      ],
      data: [
        {
          name: '栏目1',
          age: 10
        },
        {
          name: '栏目2',
          age: 11
        }
      ]
    }
  },
  components: {},
  methods: {
    add() {
      setInterval(() => {
        this.a++
      }, 1e3)
      this.$Modal.confirm({
        title: '标题',
        okText: '确定',
        cancelText: '取消',
        render: () => {
          return <test>测试{this.a}</test>
        },
        onOk() {},
        onCancel() {}
      })
    },
    add2() {
      this.$Modal.confirm({
        title: '标题',
        okText: '确定',
        cancelText: '取消',
        render(h) {
          return h(
            r('Button'),
            {
              onClick() {
                alert(1)
              },
              props: {
                type: 'default'
              }
            },
            '测试'
          )
        },
        onOk() {},
        onCancel() {}
      })
    }
  },
  mounted() {
    function abc(a, b) {
      return a + b
    }
  }
}
</script>
<style lang="scss" scoped></style>
